package com.firefightingiot.firefightingiot.web.web;

import cn.hutool.json.JSONObject;
import com.firefightingiot.firefightingiot.common.base.BaseController;
import com.firefightingiot.firefightingiot.support.annotaion.Action;
import com.firefightingiot.firefightingiot.support.annotaion.At;
import com.firefightingiot.firefightingiot.support.model.RespEntity;
import com.firefightingiot.firefightingiot.web.service.SendMsgStateService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * @author Yang yu
 * @version 1.0
 * @date 2020/8/26 16:07
 */
@Action
@RequestMapping(value="sendMsgState")
public class SendMsgStateController extends BaseController {
    @Resource
    private SendMsgStateService sendMsgStateService;

    /**
     * 语音短信状态列表
     * @param jsonParam
     * @return
     */
    @At(value = "getSendMsgStateList", method = RequestMethod.GET)
    public RespEntity getSendMsgStateList(@RequestBody(required = false) JSONObject jsonParam) {
        return sendMsgStateService.getSendMsgStateList(jsonParam);
    }

    /**
     * 设备语音短信状态新增
     * @param jsonParam
     * @return
     */
    @At(value = "insertSendMsgState", method = RequestMethod.POST)
    public RespEntity insertSendMsgState(@RequestBody(required = false) JSONObject jsonParam) {
        return sendMsgStateService.insertSendMsgState(jsonParam);
    }

    /**
     * @Author YangYu
     * @Description 通讯记录分页列表
     * @Date Created in 17:39 2022/5/5
     * @Param [jsonParam]
     */

    @At(value = "getCommunicationRecordListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity getCommunicationRecordListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return sendMsgStateService.getCommunicationRecordListPage(jsonParam);
    }

    /**
     * 设备语音短信状态新增
     * @param jsonParam
     * @return
     */
    @At(value = "oneClickOnOrOff", method = RequestMethod.POST, param = { "businessId","type","state","deviceClassify"})
    public RespEntity oneClickOnOrOff(@RequestBody(required = false) JSONObject jsonParam) {
        return sendMsgStateService.oneClickOnOrOff(jsonParam);
    }

}
